package com.webserver.core;

import java.io.IOException;
import java.io.InputStream;
import java.net.Socket;

/**
 * 处理与指定客户端的一次HTTP交互
 * */
public class Clienthandler implements Runnable {
    private Socket socket;
    public Clienthandler(Socket socket){
        this.socket = socket;
    }
    public void run(){
        try {
            InputStream  in = socket.getInputStream();
            int d;
            while ((d=in.read())!=-1){
                System.out.print((char)d);
            }



        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}
